<%@page import="com.wframe.framework.util.UploadUtil"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<%
request.setAttribute("fileserver",UploadUtil.getConfig().getDownserver());
%>
<div class="orderinfo">
<div class="right-title"><span></span><label style="float:left">订单详情</label><a class="fr" href="javascript:hideorderinfo();">返回订单列表</a></div>
		<c:if test="${order.paytype==2 }">
		<div class="step-main">
           	<div class="step-hd">
               	<span>创建订单</span>
               	<span>订单发货</span>
               	<span>订单收货</span>
               	<span>订单完成</span>
               </div>
           	<div class="step-ico cur-<c:choose><c:when test="${order.status>=7 }">2</c:when><c:when test="${order.status>=9 }">3</c:when><c:when test="${order.status>9 }">4</c:when><c:otherwise>1</c:otherwise></c:choose>"></div>
           	<div class="step-time clearfix">
               	<span>${order.ordertime}</span>
               	<span>${order.sendtime}</span>
               	<span>${order.receipttime}</span>
               	<span>${order.receipttime}</span>
               </div>
           </div>
      </c:if>
<div class="ht">
	<p class="t"><span>订单编号：${order.code }</span><span>订单时间：${order.ordertime }</span></p>
	<p>当前订单状态：${order.statustxt }</p>
	<p class="btn">
		<c:choose>
			<c:when test="${order.status==1}">
				<a href="javascript:cancelorder('${order.code }');">取消订单</a>
				<a href="${ctx }/payment/cashier/${order.code }">去支付</a>
			</c:when>
			<c:when test="${order.status==2 || (order.status==3 && order.issyn<=0)}">
				<a href="javascript:cancelorder('${order.code }');">取消订单</a>
			</c:when>
			<c:when test="${order.status==7}">
				<a href="javascript:shouhuo('${order.code }');">确定收货</a>
			</c:when>
			<c:when test="${order.status==9 || order.status==11}">
          	 	<%--<c:if test="${order.backtag==0 }">--%>
                    <%--<a href="javascript:tuoihuo('${order.code }');">申请退货</a>--%>
                <%--</c:if>--%>
          	 	<%--<c:if test="${order.commenttag==1 }">--%>
          	 		<%--<!--  <a href="javascript:;">去评价</a>-->--%>
          	 	<%--</c:if>--%>
          	 	<a href="javascript:buyagain('${order.code }');">再次购买</a>
          	 </c:when>
         </c:choose>
	</p>
</div>
<div class="hc">
	<p class="p">收货信息：${order.receipt_user } ${order.receipt_phone } ${order.receipt_shen } ${order.receipt_shi } ${order.receipt_qu } ${order.receipt_address }</p>
	<p class="p">配送方式：物流配送</p>
	<p class="p">支付方式：<c:choose><c:when test="${order.paytype==1}">微信支付</c:when><c:when test="${order.paytype==2}">货到付款</c:when></c:choose></p>
	<p class="p">备注信息：${order.bz }</p>
	<div class="hh">购物清单</div>
	<div class="addre-con" style="width:100%;padding:0px;margin:0px;">
   		<ul>
             <li class="th">
                  <span class="d1">订单信息</span>
                  <span class="d6">厂家</span>
                  <span class="d2">单价</span>
                  <span class="d3">数量</span>
                  <span class="d4">小计</span>
                  <span class="d5">操作</span>
            </li>
            <c:forEach items="${products }" var="product" varStatus="status">
                    <li class="tr" style="border-width:1px;">
                     	<span class="d1" style="text-align:left">
                     		<div class="td-inner">
                     			<div style="float:left"> <a href="${ctx }/product/info?priceid=${product.id}" target="_blank"><img src="${fileserver}${product.photo}" onerror="this.src='${ctx }/website/images/noimg.jpg'" width="90" height="90" alt=""></a></div>
                     			<div style="float:left;padding-left:15px; line-height: 90px">
                      			<p><c:if test="${product.gift==1}"><em>赠品</em></c:if>${product.productname } ${product.name } ${product.B_guige }</p>
                     			</div>
                      </div>
                     </span>
                        <span class="d6 ptd">${product.B_chanjia}</span>
                        <span class="d2 ptd">￥${product.buyprice }</span>
                        <span class="d3 ptd">×${product.buyamount }</span>
                        <span class="d4 ptd">￥${product.sumprice }</span>
                        <span class="d5 ptd" style="padding-top:30px;">
                         	<a sid="sid-cart-fly" href="javascript:;" onclick="addToCart(${product.id})" style='color:#0daeff'>加入购物车</a>
                        </span>
                </li>
             </c:forEach>
        </ul>
    </div>
    <div class="ot">
    	<div class="line8"></div>
		<div style="text-align:right">
			<p><span>共<font style="color:red">${products.size() }</font>件商品   商品总额：</span><span>￥${order.order_money }</span></p>
			<p><span>促销优惠：</span><span>-￥${order.reduce_money }</span></p>
			<p><span>优惠券抵扣：</span><span>-￥${order.yh_money }</span></p>
			<p class="b"><span>应付总额：</span><span style="color:red">￥${order.pay_money }</span></p>
		</div>
		<div class="line8"></div>
	</div>
</div>
</div>